#include <qcoreapplication.h>
#include <qtcpserver.h>
#include <Windows.h>

#include "QQHandle.h"

#include <spdlog/spdlog.h>
#include <spdlog/sinks/basic_file_sink.h>
#include <spdlog/sinks/stdout_color_sinks.h>

#include "QQSettings.h"
#include "QQLog.h"

int main(int argc, char* argv[])
{
	QCoreApplication a(argc, argv);
	qq_log->init();
	qq_sql->init();
	qDebug() << "app init success,about three and database";
	QTcpServer server;
	server.listen(QHostAddress::Any, 8888);
	QObject::connect(&server, &QTcpServer::newConnection, [&server]() {
		QQHandle::get_instance()->add_new_socket(server.nextPendingConnection());
		});
	qDebug() << "application is quitting";
	return a.exec();
}
